package main

import "fmt"

func changePtr(i *int) (r *int) {
	r = i
	defer func() {
		a := 20
		r = &a
	}()

	return
}

func main() {
	i := 10
	p := &i
	fmt.Printf("the pointer of i: %v\n", p)
	// fmt.Printf("the value of i: %d\n", p)
	ptr := changePtr(p)

	fmt.Printf("pointer ptr: %v \n", ptr)
	fmt.Println("the value of prt", *ptr)
	fmt.Printf("pointer p: %v\n", p)
	fmt.Println("the value of p", *p)
}
